home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / crdepp.zip / TVIEW.C < prev   
Text File  |  1991-01-04  |  2KB  |  49 lines

  1. /* tview.c */
  2.  
  3. /***********************************************************************/
  4. /*                                                                     */
  5. /* Command-line program which will allows you to view any CRDE table.  */
  6. /*                                          */
  7. /* Usage: tview <tablename>                                            */
  8. /*                                                                     */
  9. /* To compile this program requires the creation of a project file     */
  10. /* which should look something like                                    */
  11. /*                                                                     */
  12. /*   tview                                                             */
  13. /*   crde.lib                                                          */
  14. /*                                                                     */
  15. /***********************************************************************/
  16.  
  17. #include <stdio.h>
  18. #include <conio.h>
  19. #include "crde.h"
  20.  
  21.  
  22. int tbuffers = 128;
  23.  
  24. int main(int argc, char *argv[])
  25. {
  26.   TABLE *t;
  27.   int i;
  28.  
  29.   if (argc < 2) {
  30.     printf("usage: tview <tablename>\n");
  31.     exit(1);
  32.   }
  33.  
  34.   if ((t = topen(argv[1])) == NULL) {
  35.     printf("Unable to open table (error code = %d).\n", terrno);
  36.     exit(1);
  37.   }
  38.  
  39.   clrscr();
  40.   gotoxy(3, 2); printf("Viewing table %s.", argv[1]);
  41.   gotoxy(3, 3); printf("%ld rows found.", trows(t));
  42.   if (tview(t, NULL, NULL, 3, 4, 78, 23, 0x07, 0x07, 0x07, NULL) < 0)
  43.     printf("Error %d occurred. Program aborted.", terrno);
  44.  
  45.   tclose(t);
  46. }
  47.  
  48.  
  49. /* end of tview.c */